package com.foreknow.elmboot.controller;

import com.foreknow.elmboot.po.User;
import com.foreknow.elmboot.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/UserController")
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping("/getUserByIdByPass")
    public User getUserByIdByPass(@RequestParam(value = "userId")String userId, @RequestParam(value = "password")String password) throws Exception{
        return userService.getUserByIdByPass(userId,password);
    }

    @RequestMapping("/saveUser")
    public int saveUser(String userId,String password,String userName,String userSex)throws Exception{
        return userService.saveUser(userId,password,userName,userSex);
    }
}
